import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/appUser/appAdd',
    method: 'post',
    data
  })
}

export function del(appCode, ids) {
  return request({
    url: 'api/appUser/delete/' + appCode,
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/appUser/appEdit',
    method: 'put',
    data
  })
}

export function selectAllUser() {
  return request({
    url: 'api/appUser/selectAllUser',
    method: 'get'
  })
}

export function getAppUserRole(username) {
  return request({
    url: 'api/appUser/getAppUserRole?username=' + username,
    method: 'get'
  })
}

export function findUserByUserName(username) {
  return request({
    url: 'api/appUser/findUserByUserName?username=' + username,
    method: 'get'
  })
}

export function getCrunUserAppPermission(appCode) {
  return request({
    url: 'api/appUser/getCrunUserAppPermission/' + appCode,
    method: 'get'
  })
}

export default { add, edit, del, selectAllUser, getAppUserRole, findUserByUserName, getCrunUserAppPermission }
